package com.ning.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.ning.dao.UserDao;
import com.ning.pojo.User;

public class UserDaoImpl extends HibernateDaoSupport implements UserDao {

	@Override
	public User getUserByLoginName(String loginName) {
		String sql = "from User where loginName = '"+loginName+"'";
		List<User> list = (List<User>)this.getHibernateTemplate().find(sql);
		if(0 >= list.size()){
			return null;
		}
		User user1 = list.get(0);
		return user1;
	}

}
